package com.jincheng.service.impl;

import com.jincheng.mapper.AuctionMapper;
import com.jincheng.mapper.AuctionuserMapper;
import com.jincheng.pojo.Auction;
import com.jincheng.pojo.Auctionuser;
import com.jincheng.service.AuctionService;
import com.jincheng.service.AuctionuserService;
import com.jincheng.utils.MybatisUtil;
import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * @author Jane
 * @date 2024-12-13 10:01
 */
//@Component
//@Component("auctionuserService")
@Service("auctionService")
public class AuctionServiceImpl implements AuctionService {

    @Override
    public List<Auction> findAcutionList(Auction auction, int currpage, int pagesize) {

        SqlSession session = MybatisUtil.createSqlSession(false);

        currpage=currpage<=0?1:currpage;

        currpage = (currpage - 1) * pagesize;

        List<Auction> list = session.getMapper(AuctionMapper.class).findAcutionList(auction, currpage, pagesize);

        MybatisUtil.closeSqlSession(session);

        return list;
    }
}
